package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shopping.mapper.MallClassifyMapper;
import com.ruoyi.shopping.domain.MallClassify;
import com.ruoyi.shopping.service.IMallClassifyService;

/**
 * 商城分类Service业务层处理
 *
 * @author scx
 * @date 2022-06-10
 */
@Service
public class MallClassifyServiceImpl implements IMallClassifyService
{
    @Autowired
    private MallClassifyMapper mallClassifyMapper;

    /**
     * 查询商城分类
     *
     * @param id 商城分类主键
     * @return 商城分类
     */
    @Override
    public MallClassify selectMallClassifyById(Long id)
    {
        return mallClassifyMapper.selectMallClassifyById(id);
    }

    /**
     * 查询商城分类列表
     *
     * @param mallClassify 商城分类
     * @return 商城分类
     */
    @Override
    public List<MallClassify> selectMallClassifyList(MallClassify mallClassify)
    {
        return mallClassifyMapper.selectMallClassifyList(mallClassify);
    }

    /**
     * 新增商城分类
     *
     * @param mallClassify 商城分类
     * @return 结果
     */
    @Override
    public int insertMallClassify(MallClassify mallClassify)
    {
        mallClassify.setCreateTime(DateUtils.getNowDate());
        return mallClassifyMapper.insertMallClassify(mallClassify);
    }

    /**
     * 修改商城分类
     *
     * @param mallClassify 商城分类
     * @return 结果
     */
    @Override
    public int updateMallClassify(MallClassify mallClassify)
    {
        mallClassify.setUpdateTime(DateUtils.getNowDate());
        return mallClassifyMapper.updateMallClassify(mallClassify);
    }

    /**
     * 批量删除商城分类
     *
     * @param ids 需要删除的商城分类主键
     * @return 结果
     */
    @Override
    public int deleteMallClassifyByIds(Long[] ids)
    {
        return mallClassifyMapper.deleteMallClassifyByIds(ids);
    }


    /**
     * 批量逻辑删除商城分类
     *
     * @param ids 需要删除的商城分类主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallClassify(Long[] ids,String delType,Long delUser)
    {
        return mallClassifyMapper.logicDeleteMallClassify(ids,delType,delUser);
    }

    /**
     * 删除商城分类信息
     *
     * @param id 商城分类主键
     * @return 结果
     */
    @Override
    public int deleteMallClassifyById(Long id)
    {
        return mallClassifyMapper.deleteMallClassifyById(id);
    }

    @Override
    public List<MallClassify> selectMallClassifyByIds(String[] ids) {
        return mallClassifyMapper.selectMallClassifyByIds(ids);
    }
}
